import java.util.Date;

class Immutable{
	private final int i;
	private final Date d; 
	public Immutable(int i,Date d){
		this.i = i;
		this.d = new Date( d.getTime() );//save a copy of Mutable Object
	}
	public int getI(){
		return i;
	}
	public Date getD(){
		return new Date( this.d.getTime() );//send a copy of Mutable Object
	}
}
public class ImmutableDemo {

	public static void main(String[] args) {
		Date myDate = new Date();
		Immutable im = new Immutable(1,myDate);
		System.out.println(im.getI());
		myDate.setMonth(2);
		System.out.println(im.getD());
	}

}
